You are here: Custom Study Programming > Reference > Classes > StudyData > StudyData Methods > clear

clear

The clear method deletes entire in-memory dataset for the given StudyData object instance.

 

Syntax

clear();

Example

The following example retrieves previously defined StudyData object and clears its in-memory contents when one of custom study's parameters gets changed.

 

function init()

{

addDataPlot("customSMA");

addParameter("Period", 25);

}

 

function onParameterChange(name, value)

{

//if "Period" parameter is being modified, then flush our in-memory contents for "customSMA"

if(name == "Period")

{

var studyData = this.getStudyData("customSMA");

if(studyData != null)

{

studyData.clear();

}

}

}

 

 


Copyright © 2006-2009 ActiveTick LLC